package com.bie.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.util.ServletContextAware;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.woke.bean.ChouJBean;
import com.woke.bean.CjPrizeBean;
import com.woke.bean.CustomerBean;
import com.woke.bean.UserBean;
import com.woke.dao.ChouJiang;
import com.woke.dao.CjPrize;
import com.woke.dao.Customer;
import com.woke.dao.User;

public class GetNumAction implements Action, ServletRequestAware, ServletResponseAware, ServletContextAware {
	private HttpServletRequest request;
	private HttpServletResponse responese;
	private HttpSession session;
	private ServletContext application;
	@Override
	public void setServletContext(ServletContext context) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setServletResponse(HttpServletResponse response) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
	
	
	public String getCusNum() {
		List<Customer> list=new ArrayList<Customer>();
		CustomerBean cu =new CustomerBean();
		list=cu.getCustomerList2();
		int num11=list.size();
		System.out.println("num11 :"+num11);
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num11", num11);
		return "member-list";
	}
	
	public String getCusdeleNum() {
		List<Customer> list=new ArrayList<Customer>();
		CustomerBean cu =new CustomerBean();
		list=cu.getCustomerList3();
		int num=list.size();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		return "member-del";
	}
	
	public String getPrizeNum() {
		List<Customer> list=new ArrayList<Customer>();
		CustomerBean cu =new CustomerBean();
		list=cu.getCustomerList4();
		int num=list.size();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		return "isprize";
	}
	public String getNoPrizeNum() {
		List<Customer> list=new ArrayList<Customer>();
		CustomerBean cu =new CustomerBean();
		list=cu.getCustomerList5();
		int num=list.size();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		return "noprize";
	}
	
	public String getUserNum() {
		List<User> list=new ArrayList<User>();
		UserBean cu =new UserBean();
		list=cu.getUserList();
		int num=list.size();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		return "adminlist";
	}
	
	public String getEventNum() {
		List<ChouJiang> list=new ArrayList<ChouJiang>();
		ChouJBean cu =new ChouJBean();
		list=cu.getChouJList1();
		int num=list.size();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		return "Eventlist";
	}
	
	public String getPnum() {
		List<CjPrize> list=new ArrayList<CjPrize>();
		CjPrizeBean cu =new CjPrizeBean();
		list=cu.getCjPrizeList();
		int num=list.size();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		return "prizelist";
	}
	
	public String getAllNum() throws Exception {
		ShuJuAction su=new ShuJuAction();
		su.getMonthNum();
		su.getMonthNum1();
		su.getMonthNum2();
		su.getnum1();
		return "index";
	}
	
	public String getPrecentNum() {
		List<Customer> list=new ArrayList<Customer>();
		CustomerBean cu =new CustomerBean();
		list=cu.getCustomerList4();
		List<Customer> list1=new ArrayList<Customer>();
		list1=cu.getCustomerList1();
		int num=list.size();
		
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession(); 
		session.put("num", num);
		
		return null;
	}
}
